﻿using System.Web.Mvc;
using YogaStudio.Service;
using System.Linq;
using YogaStudio.Service.BLL;

namespace YogaStudio.WebUI.Controllers
{
    public class HomeController : Controller
    {
        private readonly IProductService _productService;

        public HomeController() : this(new ProductService()) { }

        public HomeController(IProductService productService)
        {
            _productService = productService;
        }

        public ActionResult Index()
        {
            var products = _productService.GetTopBestSellingProducts(4);
            return View(products);
        }


      public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}